﻿@model BugTracker.Models.User

@{
    ViewBag.Title = "Edit";
    Layout = "~/Views/Shared/_LayoutAdmin.cshtml";
}

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)
    
<fieldset>

            @Html.HiddenFor(model => model.user_idPK)
<br />
<br />
      
       <div class="editor-label">
            @Html.Label("Username:")
        </div>

<br />
        <div class= "editor-field">
            @Html.TextBoxFor(model => model.user_name)
            @Html.ValidationMessageFor(model => model.user_name)
        </div>
        
        <div class="editor-label">
            @Html.Label("Password:")
        </div>

<br />
        <div class= "editor-field">
            @Html.PasswordFor(model => model.password)
            @Html.ValidationMessageFor(model => model.password)
        </div>

        <div class="editor-label">
            @Html.Label("Firstname:")
        </div>

<br />
        <div class="editor-field">
            @Html.TextBoxFor(model => model.first_name)
            @Html.ValidationMessageFor(model => model.first_name)
        </div>
        <div class="editor-label">
            @Html.Label("Lastname:")
        </div>

<br />
        <div class="editor-field">
            @Html.TextBoxFor(model => model.last_name)
            @Html.ValidationMessageFor(model => model.last_name)
        </div>

<br />
        <div>
        <b>Role :  &nbsp; @Html.DropDownListFor(model => model.role_idFK,
                            new SelectList(ViewData["role_idPK"] as System.Collections.IEnumerable,
                            "role_idPK", "role_name"))</b>
        </div>
<br />
<br />
<p>
       <input type = "submit" value = "Save" />
</p>
<div>
    @Html.ActionLink("Back to List", "DeleteUser")
</div>

<br />
<br />
  </fieldset>  
}

